<template>
  <div>
    <van-field label="标题" v-model="form.title"/>
    <van-field label="内容" v-model="form.content"/>
    <van-button @click="fb">发布</van-button>
  </div>
</template>

<script>
import maxios from "@/http/axios";
export default {
  name: "add_wz",
  data() {
    return {
      form:{},
      userid:localStorage.getItem('userid')
    }
  },
  methods:{
    fb(){
      maxios('/book/add_book?userid='+this.userid,'post',this.form).then(res=>{
        if(res.code==200){
          alert('发布成功等待审核')
        }else {
          alert('抱歉出错了')
        }
      })
    }
  }
}
</script>

<style scoped>

</style>